home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17040 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  845 b 

  1. Path: nntp.teleport.com!usenet
  2. From: GHouck <hksys@teleport.com>
  3. Newsgroups: comp.lang.c,comp.lang.c++
  4. Subject: Re: Q:Hex to Decimal?
  5. Date: 13 Apr 1996 07:17:56 GMT
  6. Organization: systems hk
  7. Message-ID: <4knkf4$i9s@nadine.teleport.com>
  8. References: <316D2289.4759@tricon.net>
  9. NNTP-Posting-Host: ip-pdx14-40.teleport.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  14.  
  15. Thomas A Cooper <tacooper@tricon.net> wrote:
  16. [snip]
  17. > I'm struggling with the reverse situation, a function to convert an 
  18. >integer into a HEX string. Anybody got any ideas?? Thanks in advance for 
  19. >your help.
  20. Tom,
  21.  
  22. The easiest solution would be (in my judgement):
  23.  
  24.   sprintf( string,"%x",integervalue );
  25.  
  26. (you can control width of output as well: e.g.:  "%04x", etc)
  27.  
  28. Yours, Geoff Houck
  29.  
  30.  
  31.